home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib7 / v_09_11 / 9n11116a < prev    next >
Encoding:
Text File  |  1995-11-01  |  728 b   |  32 lines

  1.  
  2. Listing 2
  3.  
  4. void find_min_max(one, two, three, minimum, maximum)
  5.    int one, two, three;  /* Input values to compare */
  6.    int *minimum;    
  7.    int *maximum;
  8.        {
  9.        if (one > two)
  10.            {
  11.            if (one > three)
  12.                *maximum = one;
  13.            else
  14.                *maximum = three;
  15.            if (two > three)
  16.                *minimum = three;
  17.            else
  18.                *minimum = two;
  19.        else
  20.            {
  21.            if (two > three)
  22.                *maximum = two;
  23.            else
  24.                *maximum = three;
  25.            if (one > three)
  26.                *minimum = three;
  27.            else
  28.                *minimum = one;
  29.            }
  30.        return ;
  31.        }
  32.